﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using xunsearch.lib;
using System.Text;
namespace xunsearch.web
{
    public partial class _default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            EXunSearch search = new EXunSearch();
            search.init();
            Dictionary<string, string> add_doc = new Dictionary<string, string>();
            add_doc.Add("pid", "11");
            add_doc.Add("subject", "农行网银可以西联汇款-农业银行");
            add_doc.Add("message", "西联汇款利用全球先进的电子金融网络，瞬间及时处理每笔汇款。无论客户需要将汇款送及世界的哪个角落，都将在短短几分钟内安全到达。有网友向小编提出农业银行西联汇款可以用网银收汇吗?农行网银可以收汇西联汇款吗?");
            search.add(add_doc);
            Response.Write("add end");
            Response.End();


            

            string str1 = "subject:农行网银";
            
            search._xs.getSearch().setQuery(str1);
            List<XSDocument> list = search._xs.getSearch().setLimit(5, 0).search();
            this.Response.Write(string.Format("count={0}<br>", list.Count));
            foreach (XSDocument doc in list) 
            {
                this.Response.Write(string.Format("pid={0}<br>", doc.__get("pid")));
                this.Response.Write(string.Format("subject={0}<br>", doc.__get("subject")));
                this.Response.Write(string.Format("message={0}<br>", doc.__get("message")));
            }
        }
    }
}